<template>
<el-container>
  <el-aside class=" zuo_lef" 
   :width="zuo+'px'"  v-if='left'>
    <lefnav></lefnav>
  </el-aside>
  <el-container >
    <el-header v-if='left'>
      <!-- 头部 -->
      <Headertop @qianhuan = 'qianhuan'></Headertop>
    </el-header>
    <el-main>
      <!-- 路由 -->
      <router-view />
    </el-main>
  </el-container>
</el-container>
</template>
<script>
import lefnav from './components/lef_nav';
import Headertop from './components/Header';
export default {
  components:{ lefnav ,Headertop },
  data() {
    return {
      left:true,
      zuo:200,
      index:1
    };
  },
  methods:{
    qianhuan(){
      this.zuo = this.zuo==0?200:0
    }
  },
  created(){
    let url =  this.$router.history._startLocation
    if (url=='/login'||url=='/'||url=='/register') {
      this.left = false
    }else{
      this.left = true
    }
  }
};
</script>


<style lang="scss" scope>
html,body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
.el-header, .el-footer {
    color: #333;
    text-align: center;
    line-height: 60px;
    margin: 0;
    padding: 0;
  }
  
  .el-aside {
    color: #333;
    text-align: center;
    float: left;
    height: 100%;
    box-shadow: 1px 1px 5px #aaa;
    transition: .8s;
  }
  
  .el-main {
    // background-color: #E9EEF3;
    color: rgb(51, 51, 51);
    text-align: center;
    height: 100%;
  }
  .cell{
    color: rgb(60, 60, 131);
  }
  body > .el-container {
    height: 100%
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  .is-vertical{
    width: calc(100% - 200px);
    height: calc(100% - 60px);
    float: right;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
